/*
 * Copyright (c) 2025 Industrial Software Feature Database
 */
package com.comac.ins.service;

import com.comac.ins.common.BaseResult;
import com.comac.ins.common.PagerEntity;
import com.comac.ins.config.FeignConfiguration;
import com.comac.ins.vo.req.FeignSelectEmployeeListByNameOrCodeRequestVO;
import com.comac.ins.vo.req.FeignSelectEmployeeListRequestVO;
import com.comac.ins.vo.req.FeignSelectOrgInfoByEmployeeCodeListVO;
import com.comac.ins.vo.res.FeignEmployeeOrgInfoListVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;
import java.util.Map;

/**
 * @author fan.tianpeng
 * @date 2021/6/2 11:30
 */
@FeignClient(url = "${feign.userCenterUrl:}", value = "usercenter-service", contextId = "usercenter-employee", configuration = FeignConfiguration.class)
@Api(tags = "员工管理", value = "员工管理")
public interface EmployeeFeignService {

    /**
     * 通过员工标识列表查询对应的员工名称映射关系
     *
     * @param vo 员工标识列表
     * @return 员工映射关系
     */
    @RequestMapping(value = "feignApi/userCenter/employee/qryEmployeeNameMap", method = RequestMethod.POST)
    @ApiOperation(value = "通过员工标识列表查询对应的员工名称映射关系")
    BaseResult<Map<Long, String>> qryEmployeeNameMap(@RequestBody List<Long> vo);

    @RequestMapping(value = "feignApi/userCenter/employee/selectPage", method = RequestMethod.POST)
    @ApiOperation(value = "分页查询员工")
    PagerEntity selectPage(@RequestBody FeignSelectEmployeeListRequestVO vo);

    //联想查询，输入工号或姓名均可
    @RequestMapping(value = "feignApi/userCenter/employee/selectPageByNameOrCode", method = RequestMethod.POST)
    @ApiOperation(value = "联想查询，输入工号或姓名均可")
    PagerEntity selectPageByNameOrCode(@RequestBody FeignSelectEmployeeListByNameOrCodeRequestVO vo);

    @RequestMapping(value = "feignApi/userCenter/employee/selectOrgNameLinkByEmployeeCodes", method = RequestMethod.POST)
    @ApiOperation(value = "根据工号清单查询员工的主部门名称链路")
    BaseResult<Map<String, String>> selectOrgNameLinkByEmployeeCodes(@RequestBody List<String> employeeCodeList);

    @RequestMapping(value = "feignApi/userCenter/employee/selectOrgInfoByEmployeeCodeList", method = RequestMethod.POST)
    @ApiOperation(value = "根据员工工号批量查询人员所在主部门及主部门所在公司信息")
    BaseResult<List<FeignEmployeeOrgInfoListVO>> selectOrgInfoByEmployeeCodeList(@RequestBody @Validated FeignSelectOrgInfoByEmployeeCodeListVO vo);

    //通过员工工号列表查询对应的员工名称映射关系
    @RequestMapping(value = "feignApi/userCenter/employee/qryEmployeeNameMapByCodes", method = RequestMethod.POST)
    @ApiOperation(value = "通过员工工号列表查询对应的员工名称映射关系")
    BaseResult<Map<String, String>> qryEmployeeNameMapByCodes(@RequestBody List<String> emoCodeList);
}

